<el-card id="login-page">
	<div slot="header" class="card-label">
		<el-col :sm="5" class="icon-button">
			<el-button :type="isPhone ? 'success' : 'primary'" :icon="isPhone ? 'el-icon-s-custom' : 'el-icon-mobile-phone'" circle size="medium"
				@click="change"></el-button>
		</el-col>
		<el-col :sm="14" class="title"><span>欢迎登录商城管理系统</span></el-col>
		<el-col :sm="5" class="lang">
			<el-dropdown>
				<span class="el-dropdown-link">{{$t("lang")}}<e-icon icon-name="el-icon-arrow-down el-icon--right"></e-icon></span>
				<el-dropdown-menu slot="dropdown">
					<el-dropdown-item @click.native="setLang('zh')"><span :class="activeLang === 'zh' ? 'active-lang' : ''">中文</span></el-dropdown-item>
					<el-dropdown-item @click.native="setLang('en')"><span :class="activeLang === 'en' ? 'active-lang' : ''">English</span></el-dropdown-item>
				</el-dropdown-menu>
			</el-dropdown>
		</el-col>
	</div>
	<el-form :model="sysUser" :rules="rules" ref="loginForm" size="medium" label-position="right">
		<el-row>
			<template v-if="isPhone">
				<el-form-item label="手机号" prop="phone">
					<el-col :sm="24" class="input">
						<el-input prefix-icon="el-icon-mobile-phone" v-model="sysUser.phone" autocomplete="on" clearable></el-input>
					</el-col>
				</el-form-item>
			</template>
			<template v-else>
				<el-form-item label="用户名" prop="userName">
					<el-col :sm="24" class="input">
						<el-input prefix-icon="el-icon-s-custom" v-model="sysUser.userName" autocomplete="on" clearable></el-input>
					</el-col>
				</el-form-item>
			</template>
		</el-row>
		<el-row>
			<el-form-item label="密码" prop="password">
				<el-col :sm="24" class="input">
					<el-input prefix-icon="el-icon-unlock" v-model="sysUser.password" autocomplete="on" show-password clearable @keyup.enter.native="login"></el-input>
				</el-col>
			</el-form-item>
		</el-row>
		<el-row class="box clearfix">
			<el-col :sm="4" :offset="3">
				<div>
					<el-checkbox v-model="checked" label="记住密码" border size="small" @change="rememberMe"></el-checkbox>
				</div>
			</el-col>
			<el-col :sm="8" :offset="8">
				<router-link :to="{path: '/forgot-pwd'}">
					<el-tag type="warning" size="medium" effect="plain" :hit="true">忘记密码</el-tag>
				</router-link>
			</el-col>
		</el-row>
		<el-row>&nbsp;</el-row>
		<el-row>
			<el-form-item>
				<el-col :sm="24" class="form-button">
					<router-link :to="{path: '/register'}">
						<el-button type="warning">注册</el-button>
					</router-link>
					<el-button type="primary" @click="login">登录</el-button>
				</el-col>
			</el-form-item>
		</el-row>
	</el-form>
</el-card>
